package com.eastjet.maintenance.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.eastjet.maintenance.domain.InitialInventory;
import com.eastjet.maintenance.mapper.InitialInventoryMapper;
import com.eastjet.maintenance.service.InitialInventoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 杨博文
 * @description 针对表【initial_inventory(初期库存)】的数据库操作Service实现
 * @createDate 2024-11-25 09:23:38
 */
@Service
public class InitialInventoryServiceImpl extends ServiceImpl<InitialInventoryMapper, InitialInventory> implements InitialInventoryService {

    @Override
    public Boolean InsertInventory(List<InitialInventory> inventory) {
        return this.saveBatch(inventory);
    }

    @Override
    public Boolean UpdateInventory(List<InitialInventory> inventory) {
        return this
                .updateBatchById(inventory);
    }

    @Override
    public Boolean DeleteInventory(List<String> id) {
        return this.removeByIds(id);
    }

    @Override
    public List<InitialInventory> SelectInventory(String code) {
        return this.list(new QueryWrapper<InitialInventory>().and(i -> i.eq("code", code).eq("tombstone", 0)));
    }
}




